﻿/******************************************************************************
 * 
 * Announce: CSharpKit, Basic algorithms, components and definitions.
 *           Copyright (C) ShenYongchen.
 *           All rights reserved.
 *   Author: 申永辰.郑州 (shenyczz@163.com)
 *  WebSite: http://github.com/shenyczz/CSharpKit
 *
 * THIS CODE IS LICENSED UNDER THE MIT LICENSE (MIT).
 * THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 
 * ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
 * IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
 * PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
 * 
******************************************************************************/

using System;

namespace CSharpKit.Numerics.LinearAlgebra.Factorization
{
    /// <summary>
    /// 求解程序
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface ISolver<T>
        where T : struct, IFormattable, IEquatable<T>
    {
        /// <summary>
        /// Solves a system of linear equations(求解一个线性方程组), <b>AX = B</b>.
        /// </summary>
        /// <param name="input">The right hand side  <see cref="Matrix{T}"/>, <b>B</b>.</param>
        /// <returns>The left hand side <see cref="Matrix{T}"/>, <b>X</b>.</returns>
        Matrix<T> Solve(Matrix<T> input);

        /// <summary>
        /// Solves a system of linear equations, <b>AX = B</b>.
        /// </summary>
        /// <param name="input">The right hand side <see cref="Matrix{T}"/>, <b>B</b>.</param>
        /// <param name="result">The left hand side <see cref="Matrix{T}"/>, <b>X</b>.</param>
        void Solve(Matrix<T> input, Matrix<T> result);

        /// <summary>
        /// Solves a system of linear equations, <b>Ax = b</b>
        /// </summary>
        /// <param name="input">The right hand side <see cref="Vector{T}"/>, <b>b</b>.</param>
        /// <returns>The left hand side <see cref="Vector{T}"/>, <b>x</b>.</returns>
        Vector<T> Solve(Vector<T> input);

        /// <summary>
        /// Solves a system of linear equations, <b>Ax = b</b>.
        /// </summary>
        /// <param name="input">The right hand side <see cref="Vector{T}"/>, <b>b</b>.</param>
        /// <param name="result">The left hand side <see cref="Vector{T}"/>, <b>x</b>.</param>
        void Solve(Vector<T> input, Vector<T> result);

        //}}@@@
    }


}

